home *** CD-ROM | disk | FTP | other *** search
- /* ============================================================= */
- /* intproc.c: February 1993, Frederek Althoff */
- /* ifalthof@techfak.uni-bielefeld.de */
- /* */
- /* usage: intproc <ID> */
- /* */
- /* Sends an interrupt-signal to the CLI-Process <ID>. */
- /* This program was written to interrupt Gofer, running on an */
- /* Amiga. Though it is only a makeshift, it will help you until */
- /* the ^C-problem will be fixed. */
- /* You may get Gofer's Process-Id by using the command C:Status. */
- /* */
- /* requires: Kick 2.x */
- /* ============================================================= */
-
- #include <dos/dosextens.h>
- #include <stdio.h>
-
-
- main (argc, argv)
- int argc;
- char *argv[];
- {
- struct Task *stopTask;
- long processID;
-
- if (argc != 2) {
- fprintf (stderr, "Usage: intproc <Process-ID>\n");
- exit (20L);
- }
-
- processID = atol (argv[1]);
-
- Forbid (); /* Disable task-switching */
-
- /* Get address of the process */
- if (stopTask = (struct Task *) FindCliProc (processID)) {
- Signal (stopTask, stopTask->tc_SigAlloc); /* Send interrupt-signal */
- fprintf (stdout, "CLI(%ld) interrupted.\n", processID);
- } else
- fprintf (stdout, "No such CLI-Process: %ld\n", processID);
-
- Permit (); /* Ok, switch your tasks */
- exit (0L);
- }
-
- /* 25.02.93 */
-